package com.cloud.workTest;

import org.apache.commons.lang.StringEscapeUtils;

import java.net.URLDecoder;
import java.net.URLEncoder;

public class URLtest {
    public static void main(String[] args) throws Exception{
        String url = URLEncoder.encode("https://uat.yuantutech.com/yuantu/h5-cli/1.21.7/pay-status.html?corpId=2608&unionId=3489&feeChannel=200&optType=3", "utf-8");
        System.out.println(url);
        url = URLDecoder.decode(url, "utf-8");
        String myUrl = URLDecoder.decode("patientName=%E6%9D%8E%E7%9A%93&unionId=29&corpId=261&idNo=370206197412053219&userId=620735", "utf-8");
        System.out.println(URLDecoder.decode("corpId=277&patientId=19321678&outId=6764604505601168150&openId=oAG2LuG5zLT6RyMqXFX5ao943hhE&returnUrl=https%3A%2F%2Fwww.jkqd.org.cn%2Fyuantu%2Fh5-cli%2F2.29.71%2Fregister-details-2.html%3FcorpId%3D277%26unionId%3D29%26to%3Dzndz%26pay%3D1%26id%3D6764604505601168150%26guide%3D1%26creditPayTip%3D1&creditPay=false&tradeType=JSAPI&feeChannel=185","utf-8"));
        System.out.println(myUrl);
        System.out.println(url);
        System.out.println(Boolean.parseBoolean("true"));

        String extend = StringEscapeUtils.unescapeHtml("invoiceTitle:&quot;青岛市即墨区人民医院&quot;,invoiceNo:&quot;9084817615&quot;,amount:&quot;30815&quot;,invoiceDate:&quot;2022-10-25 08:10:42&quot;,url:&quot;https://www.chinaebill.cn/d?t=501");

        System.out.println(extend);

        String registerInfo = "{\"psn_no\":\"41000000000000000000041075\",\"mdtrt_id\":\"20221021090247009866\",\"registerInput\":\"{\\\"input\\\":{\\\"data\\\":{\\\"psn_no\\\":\\\"41000000000000000000041075\\\",\\\"insutype\\\":\\\"310\\\",\\\"begntime\\\":\\\"2022-10-21 09:02:47\\\",\\\"mdtrt_cert_type\\\":\\\"02\\\",\\\"mdtrt_cert_no\\\":\\\"410725198601025720\\\",\\\"ipt_otp_no\\\":\\\"1103012452\\\",\\\"atddr_no\\\":\\\"9999\\\",\\\"dr_name\\\":\\\"段青春\\\",\\\"dept_code\\\":\\\"9999\\\",\\\"dept_name\\\":\\\"普通外科一M\\\",\\\"caty\\\":\\\"9999\\\",\\\"exp_content\\\":null}},\\\"infno\\\":\\\"2201\\\",\\\"msgid\\\":\\\"H41070301544202210210902475JBD\\\",\\\"mdtrtarea_admvs\\\":\\\"410700\\\",\\\"insuplc_admdvs\\\":\\\"410703\\\",\\\"recer_sys_code\\\":\\\"ZjytMed\\\",\\\"dev_no\\\":\\\"\\\",\\\"dev_safe_info\\\":\\\"\\\",\\\"cainfo\\\":\\\"\\\",\\\"signtype\\\":\\\"SM3\\\",\\\"infver\\\":\\\"V1.0\\\",\\\"opter_type\\\":\\\"2\\\",\\\"opter\\\":\\\"zzj\\\",\\\"opter_name\\\":\\\"自助机\\\",\\\"inf_time\\\":\\\"2022-10-21 09:02:47\\\",\\\"fixmedins_code\\\":\\\"H41070301544\\\",\\\"fixmedins_name\\\":\\\"新乡中心医院\\\",\\\"sign_no\\\":\\\"410000202208051009490000001219\\\"}\",\"registerOutput\":\"{\\\"infcode\\\":\\\"0\\\",\\\"inf_refmsgid\\\":\\\"410000202210210854250000063365\\\",\\\"refmsg_time\\\":\\\"20221021085425052\\\",\\\"respond_time\\\":\\\"20221021085425566\\\",\\\"enctype\\\":\\\"\\\",\\\"signtype\\\":\\\"\\\",\\\"err_msg\\\":null,\\\"output\\\":{\\\"data\\\":{\\\"psn_no\\\":\\\"41000000000000000000041075\\\",\\\"mdtrt_id\\\":\\\"20221021090247009866\\\",\\\"exp_content\\\":null,\\\"ipt_otp_no\\\":\\\"1103012452\\\"}}}\",\"ipt_otp_no\":\"1103012452\"}";
    }
}
